# Contributor: guddaff <guddaff@protonmail.com>
# Maintainer: guddaff <guddaff@protonmail.com>
pkgname=libspnav
pkgver=1.0
pkgrel=1
pkgdesc="library for communicating with spacenavd or 3dxsrv"
url="http://spacenav.sourceforge.net/"
arch="all"
license="BSD-3-Clause"
options="!check" #no checks
makedepends="libx11-dev"
subpackages="$pkgname-static $pkgname-dev"
source="https://github.com/FreeSpacenav/libspnav/releases/download/v$pkgver/libspnav-$pkgver.tar.gz
	configure.patch
	"

prepare() {
    default_prepare
    sed -i "s/@PKGVERSION@/$pkgver/" "$builddir"/configure
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
ae36ea51dbca7d5ba31d82ffaa46bad2bd877f5f7c077d2e711747427f6d60a000ab0c827ae6523ba6a275dbad205eea8c20520fe2575a6fa6b554ea8b5e0eaa  libspnav-1.0.tar.gz
1536a172843459c1f26806ad774194afddf93baca0421d0803337eb90b6dd4bcc9dc9b6ebcb1a4e7de0c6f52b16da51538d302a07d57f0625a3a3311a14327f9  configure.patch
"
